//
//  statusBottomView.swift
//  sinazd
//
//  Created by apple on 16/3/12.
//  Copyright © 2016年 apple. All rights reserved.
//

import UIKit
 private let w = 0.3

class statusBottomView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    
    //MARK: 设置UI界面
    private func setupUI() {
        backgroundColor = UIColor(white: 0.9, alpha: 1)
        addSubview(repostBtn)
        addSubview(commentBtn)
        addSubview(ohYeah)
        addSubview(sep1)
        addSubview(sep2)
        
        
        sep1.backgroundColor = UIColor.darkGrayColor()
        sep2.backgroundColor = UIColor.darkGrayColor()
        
        sep1.snp_makeConstraints { (make) -> Void in
            make.centerY.equalTo(self.snp_centerY)
            make.left.equalTo(repostBtn.snp_right)
            make.height.equalTo(self.snp_height).multipliedBy(0.6)
            make.width.equalTo(w)
        }
        sep2.snp_makeConstraints { (make) -> Void in
            make.centerY.equalTo(self.snp_centerY)
            make.left.equalTo(commentBtn.snp_right)
            make.height.equalTo(self.snp_height).multipliedBy(0.6)
            make.width.equalTo(w)
        }
        
        //三个按钮 平分视图
        repostBtn.snp_makeConstraints { (make) -> Void in
            make.top.bottom.left.equalTo(self)
        }
        
        commentBtn.snp_makeConstraints { (make) -> Void in
            make.top.bottom.equalTo(self)
            make.left.equalTo(repostBtn.snp_right)
            make.width.equalTo(repostBtn.snp_width)
        }
        
        ohYeah.snp_makeConstraints { (make) -> Void in
            make.top.bottom.right.equalTo(self)
            make.left.equalTo(commentBtn.snp_right)
            make.width.equalTo(commentBtn.snp_width)
        }
        
        
    }
    
    
    //MARK: 懒加载子视图
    private lazy var repostBtn: UIButton = UIFactory.buttonWithTitle("转发", backImageName: nil, textColor: UIColor.darkGrayColor(), fontSize: 12, imageName: "timeline_icon_retweet")
    private lazy var commentBtn: UIButton = UIFactory.buttonWithTitle("评论", backImageName: nil, textColor: UIColor.darkGrayColor(), fontSize: 12, imageName: "timeline_icon_comment")
    private lazy var ohYeah: UIButton = UIFactory.buttonWithTitle("点赞", backImageName: nil, textColor: UIColor.darkGrayColor(), fontSize: 12, imageName: "timeline_icon_unlike")
    
    
    private lazy var sep1:UIView = UIView()
    private lazy var sep2:UIView = UIView()
}


